<script setup >
import {ref} from 'vue'
const count =ref(10)
const hh=ref(null)
const geth1=()=>{
  console.log(count.value)
  console.dir(hh.value)
}

const inputref =ref(null)
const setfocus = ()=>{
  inputref.value.focus()
}
</script>

<template>
 <h1 ref="hh">{{count}}</h1>
 <button @click="count++">count++</button>
 <br>
 <input type="text" ref="inputref">
 <button @click="geth1">获取h1</button>
 <button @click="setfocus">设置焦点</button>
</template>
<style>
</style>